﻿using System;
using System.Windows.Media.Imaging;

namespace DotNetImage.Imaging.BasicFilters
{
    public class RotateFilter : FilterBase
    {
        public RotateFilter() { HasMultiThreadingSupport = true; }

        [ParameterAttribute(Name = "Rotate", DefaultValue = (double)Rotation.Rotate0)]
        public Rotation Rotation { get; set; }

        protected override void ProcessPerPixel(DotNetImage bmp)
        {
            bmp.BitmapImage.BeginInit();
            bmp.BitmapImage.Rotation = Rotation;
            bmp.BitmapImage.EndInit();
        }
        protected override void ProcessMT(DotNetImage bmp)
        {
            ProcessPerPixel(bmp);
        }

        protected override uint ProcessPixel(uint pixel) {/* there is nothing to do */ return 0; }

        protected override void ValidateArguments(){ /* there are no parameters to validate */ }
    }
}
